package com.rocktech.otaserver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.CountDownTimer;

public class MyBroadcastReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(final Context context, Intent intent) {
        if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {

            new CountDownTimer(10000, 1000) {
                public void onTick(long millisUntilFinished) {

                }

                public void onFinish() {
                    Intent mintent = new Intent();
                    mintent.setClassName("com.rocktech.expresscabinet", "com.rocktech.expresscabinet.ui.activity.MainActivity");
                    mintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    context.startActivity(mintent);
                }
            }.start();
        }
    }
}
